<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        :root {
            --border-size: 2px;
        }

        * {
            margin: 0;
            padding: 0;
        }

        body {
            background-color: rgba(0, 0, 0, .8);
        }

        .btn {
            width: 200px;
            height: 200px;
            background-color: aliceblue;
            margin: 200px;
            color: pink;
            text-align: center;
            line-height: 60px;
            background: conic-gradient(from var(--border-angle), #213, #112 50%, #213),
                conic-gradient(from var(--border-angle), transparent 20%, #08f, #f03);
            /* 背景缩放 留出边框位置 */
            background-size: calc(100% - (var(--border-size) * 2)) calc(100% - (var(--border-size) * 2)), cover;
            background-position: center;
            background-repeat: no-repeat;
            /* 添加动画 */
            animation: bg-spin 3s linear infinite;
        }

        @keyframes bg-spin {
            to {
                --border-angle: 1turn;
            }
        }

        /* 定义角度边框 可以让背景渐变动画 */
        @property --border-angle {
            /* 语法结构 角度 */
            syntax: "<angle>";
            /* 是否继承 */
            inherits: true;
            /* 起始值 */
            initial-value: 0turn;
        }
        
    </style>
</head>

<body>
    <div class="btn"></div>
</body>

</html>